<!-- //企业端首页 -->
<template>
	<view class="index-container" :class="currentTheme">
		<view class="header">
			<text class="title">企业端首页</text>
		</view>
		<view class="content">
			<view class="welcome-section">
				<text class="welcome-text">欢迎使用企业招聘系统</text>
				<text class="subtitle">管理您的招聘需求，寻找优秀人才</text>
			</view>
			<view class="quick-actions">
				<view class="action-item">
					<text class="action-title">发布职位</text>
					<text class="action-desc">发布新的招聘职位</text>
				</view>
				<view class="action-item">
					<text class="action-title">简历管理</text>
					<text class="action-desc">查看和管理收到的简历</text>
				</view>
				<view class="action-item">
					<text class="action-title">面试安排</text>
					<text class="action-desc">安排和管理面试流程</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentTheme: 'theme1' // 添加主题数据属性
			}
		},
		mounted() {
			// 加载主题设置
			const savedTheme = uni.getStorageSync('currentTheme');
			if (savedTheme) {
				this.currentTheme = savedTheme;
			}
			
			// 监听全局主题变化事件
			this.themeChangeHandler = (newTheme) => {
				this.currentTheme = newTheme;
			};
			uni.$on('global-theme-change', this.themeChangeHandler);
		},
		onShow() {
			// 重新加载主题设置，确保主题同步
			const savedTheme = uni.getStorageSync('currentTheme');
			if (savedTheme) {
				this.currentTheme = savedTheme;
			}
		},
		beforeDestroy() {
			// 移除全局事件监听，防止内存泄漏
			uni.$off('global-theme-change', this.themeChangeHandler);
		},
		methods: {
			
		}
	}
</script>

<style scoped>
.index-container {
	min-height: 100vh;
	padding: 20px;
	background-color: #f5f5f5;
}

.header {
	text-align: center;
	margin-bottom: 30px;
}

.title {
	font-size: 24px;
	font-weight: bold;
	color: #333;
}

.content {
	max-width: 600px;
	margin: 0 auto;
}

.welcome-section {
	text-align: center;
	margin-bottom: 40px;
	padding: 30px;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.welcome-text {
	display: block;
	font-size: 20px;
	font-weight: bold;
	color: #333;
	margin-bottom: 10px;
}

.subtitle {
	display: block;
	font-size: 14px;
	color: #666;
}

.quick-actions {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.action-item {
	padding: 20px;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	border-left: 4px solid #007aff;
}

.action-title {
	display: block;
	font-size: 16px;
	font-weight: bold;
	color: #333;
	margin-bottom: 5px;
}

.action-desc {
	display: block;
	font-size: 14px;
	color: #666;
}

/* 主题样式 */
/* Theme 1 - 蓝色主题 */
.index-container.theme1 {
	background-color: #F8FBFF;
}

.index-container.theme1 .title {
	color: #4A90E2;
	font-weight: 600;
}

.index-container.theme1 .welcome-section {
	background-color: #FFFFFF;
	border: 1px solid #E8F4FD;
	box-shadow: 0 4rpx 16rpx rgba(74, 144, 226, 0.08);
}

.index-container.theme1 .welcome-text {
	color: #4A90E2;
	font-weight: 600;
}

.index-container.theme1 .subtitle {
	color: #5A6C7D;
}

.index-container.theme1 .action-item {
	background-color: #FFFFFF;
	border-left: 4px solid #4A90E2;
	border: 1px solid #E8F4FD;
	box-shadow: 0 4rpx 16rpx rgba(74, 144, 226, 0.08);
}

.index-container.theme1 .action-item:hover {
	border-color: #4A90E2;
	box-shadow: 0 6rpx 20rpx rgba(74, 144, 226, 0.15);
}

.index-container.theme1 .action-title {
	color: #4A90E2;
	font-weight: 600;
}

.index-container.theme1 .action-desc {
	color: #5A6C7D;
}

/* Theme 2 - 棕色/米色主题 */
.index-container.theme2 {
	background-color: #FDF8F3;
}

.index-container.theme2 .title {
	color: #A0522D;
	font-weight: 600;
}

.index-container.theme2 .welcome-section {
	background-color: #FFFBF7;
	border: 1px solid #F5E6D3;
	box-shadow: 0 4rpx 16rpx rgba(160, 82, 45, 0.08);
}

.index-container.theme2 .welcome-text {
	color: #A0522D;
	font-weight: 600;
}

.index-container.theme2 .subtitle {
	color: #6D4C41;
}

.index-container.theme2 .action-item {
	background-color: #FFFBF7;
	border-left: 4px solid #A0522D;
	border: 1px solid #F5E6D3;
	box-shadow: 0 4rpx 16rpx rgba(160, 82, 45, 0.08);
}

.index-container.theme2 .action-item:hover {
	border-color: #A0522D;
	box-shadow: 0 6rpx 20rpx rgba(160, 82, 45, 0.15);
}

.index-container.theme2 .action-title {
	color: #A0522D;
	font-weight: 600;
}

.index-container.theme2 .action-desc {
	color: #6D4C41;
}

/* 禁用过渡和动画 */
.index-container * {
	transition: none !important;
	animation: none !important;
}
</style>
